package com.android.quiz;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

public class Main extends Activity {
	
    Button Start,Instructions, Exit, Database; 
	
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        
        this.Initializer();
        
    //A listener for the start button
        Start.setOnClickListener(new OnClickListener() {  public void onClick(View v) {  startActivity(new Intent(Main.this, TakeTest.class));  }  });
        
    // A listener for the database button   
        Database.setOnClickListener(new OnClickListener() {  public void onClick(View v) {  startActivity(new Intent(Main.this, database.class));  }  });
        
    // A listener for the Exit button
        Exit.setOnClickListener(new OnClickListener() {  public void onClick(View v) { finish();  }  });
        
    // A listener for the Instructions Button
        Instructions.setOnClickListener(new OnClickListener() {
			
			@Override
			public void onClick(View v) {
				startActivity(new Intent(Main.this, Rules.class));
			}
		});
        
    }
    
    private void Initializer(){
    	Start = (Button) findViewById(R.id.start);
    	Instructions = (Button) findViewById(R.id.instructions);
    	Exit = (Button) findViewById(R.id.exit);
    	Database = (Button) findViewById(R.id.database);
    }
}